// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import store from 'store'
import App from './App'
import router from './router'
import $http from './http/api'
import $storage from './storage/mStorage'
import bus from './EventBus'

import { Toast, Loading, Tab, Tabs, Tabbar, TabbarItem, ActionSheet } from 'vant'
import 'vant/lib/toast/style'
import 'vant/lib/loading/style'
import 'vant/lib/tab/style'
import 'vant/lib/tabs/style'
import 'vant/lib/tabbar/style'
import 'vant/lib/tabbar-item/style'
import 'vant/lib/action-sheet/style'

Vue.config.productionTip = false
Vue.prototype.$http = $http
Vue.prototype.$storage = $storage
Vue.prototype.$store = store
// Vue.prototype.$bus = bus
Vue.use(bus)
Vue.use(Toast)
Vue.use(Loading)
Vue.use(Tab)
Vue.use(Tabs)
Vue.use(Tabbar)
Vue.use(TabbarItem)
Vue.use(ActionSheet)
// 如果你要给vue的原型添加属性或者方法 那么要有$前缀
// 如果一个模块需要通过Vue.use来调用
// 那么这个模块必须实现install方法

/* eslint-disable no-new */

/* if (store.get('a')) {
  window.console.log(store.get('a'))
} else {
  store.set('a', 'hello,world')
  window.console.log(store.get('a'))
} */

/* store.set('a', { a: 1, b: 2 })
setTimeout(() => {
  window.console.log(store.get('a'))
  window.console.log(store.get('ab'))
}) */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
